package com.bdqn.t320.ch12;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

@SpringBootTest
@RunWith(SpringRunner.class)
public class RedisTemplateTester {

    @Resource
    private StringRedisTemplate stringRedisTemplate; //操作字符串数据
    @Resource
    private RedisTemplate redisTemplate; //操作其他数据类型

    @Test
    public void addRedisTester(){
        stringRedisTemplate.opsForValue().set("test", "100",60*10, TimeUnit.SECONDS);//
    }
}
